<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="app">
        <h1>title: {{title}}</h1>
        <ul>
            <li v-for="item in products">
                商品名称：{{item.name}}
                数量：{{item.stock}}
                <button @click="item.stock--">-</button>
                <button @click="item.stock++">+</button>
            </li>
        </ul>
    </div>
    <script src="./vue.min.js"></script>
    <script>
        new Vue({
            el: "#app",
            data: {
                title: 'My first vue',
                products: [
                    { name: 'xx1', stock: 10 },
                    { name: 'xx2', stock: 10 },
                    { name: 'xx3', stock: 10 }
                ]
            },
            render(h) {
                return h('div', [
                    h('h1', `第一个vue应用：${this.title}`),
                    h('p', `作者：${this.auther}`)
                ])
            }
        })

    </script>
</body>

</html>